package thread;

import java.io.FileReader;
import java.io.IOException;
import java.io.Reader;

public class Demo53 {
    public static void main(String[] args) throws IOException {
        try (Reader reader = new FileReader("./outFile.txt")) {
            char[] buf = new char[1024];
            while (true) {
                int n = reader.read(buf);
                System.out.println(n);
                if (n == -1) {
                    break;
                }
                for (int i = 0; i < n; i++) {
                    System.out.println(buf[i]);
                }
            }
        }
    }
}
